/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.caresms.service.impl;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;

import com.caresms.model.Category_Master;
import com.caresms.service.Category_MasterLocalService;
import com.caresms.service.Category_MasterLocalServiceUtil;
import com.caresms.service.base.Category_MasterLocalServiceBaseImpl;
import com.liferay.counter.service.CounterLocalServiceUtil;

/**
 * The implementation of the category_ master local service.
 *
 * <p>
 * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.caresms.service.Category_MasterLocalService} interface.
 *
 * <p>
 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
 * </p>
 *
 * @author cc
 * @see com.caresms.service.base.Category_MasterLocalServiceBaseImpl
 * @see com.caresms.service.Category_MasterLocalServiceUtil
 */
public class Category_MasterLocalServiceImpl
	extends Category_MasterLocalServiceBaseImpl {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never reference this interface directly. Always use {@link com.caresms.service.Category_MasterLocalServiceUtil} to access the category_ master local service.
	 */
	public void addtodb(String category,boolean active){
		long catId =0L;
		  try {
		   
		   catId=CounterLocalServiceUtil.increment();
		   Category_Master c= category_MasterLocalService.createCategory_Master(catId);
		   c.setCatName(category);
		   c.setIsActive(active);
		 
		   category_MasterPersistence.update(c, false);
		   System.out.println("okkkk");
		   
	}
		  catch(Exception e){
			// TODO: handle exception
		  }
}
}